/*
 * Copyright (c) 2013 iTAC Software AG, Germany. All Rights Reserved.
 * 
 * This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
 * printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
 * without the written permission of iTAC Software AG.
 */
package org.template.portal;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

// TODO
/**
 * @author rafal.kojta
 */
@Entity
@Table(name = "root_directory")
public class RootDirectory {

  @Id
  @GeneratedValue(strategy = IDENTITY)
  @Column(name = "ROOT_DIRECTORY_ID", unique = true, nullable = false)
  private long rootDirectoryId;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "GROUP_ID")
  private YearGroup yearGroup;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "rootDirectory")
  private Set<Directory> directories;

  public long getRootDirectoryId() {
    return rootDirectoryId;
  }

  public void setRootDirectoryId(long rootDirectoryId) {
    this.rootDirectoryId = rootDirectoryId;
  }

  public YearGroup getYearGroup() {
    return yearGroup;
  }

  public void setYearGroup(YearGroup group) {
    this.yearGroup = group;
  }

  public Set<Directory> getDirectories() {
    return directories;
  }

  public void setDirectories(Set<Directory> directories) {
    this.directories = directories;
  }

}
